<template>
    <el-form :model="question"  ref="formInline" label-width="100px" >
        <div class="form-item-title">
            <span class="title-level">正确答案</span>
        </div>
        <el-row :gutter="41">
            <el-col >
                <el-form-item label="请选择答案" prop="answer">
                    <el-radio-group v-model="question.isCorrect" @change="changeType">
                        <el-radio class="radio"   label="Y">正确</el-radio>
                        <el-radio class="radio"   label="N">错误</el-radio>
                    </el-radio-group>
                </el-form-item>
            </el-col>
        </el-row>
    </el-form>
</template>

<script>
export default {
    name: 'addNewQuestionOptions',
    data() {
        return {
            question: {
                isCorrect: ''
            },
            rules: {
                answer: [
                    { required: true, message: '请选择答案', trigger: 'blur' }
                ]
            }
        }
    },
    methods: {
        changeType(type) {
            // this.question.isCorrect = type;
            this.$emit('answer', type);
        },
        setCheck(isCorrect) {
            this.question.isCorrect = isCorrect;
        }
    }
  
}
</script>

<style lang="scss" scoped>
.form-item-title{
    margin: 40px 0;
    font-size: 14px;
    color: #333;
    line-height: 14px;
    border-left: 4px solid #ff5e2c;
    text-indent: 16px;
}


</style>


